/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * POS_MainClerk.java
 *
 * Created on Apr 4, 2011, 1:31:04 PM
 */

package POS_Source;

import POS_Controller.POSController;
import Utilities.MoneyFormatter;
import javax.swing.JPanel;

/**
 * this class renders main in view for clerk after clerk logs  in
 * @author edaype
 * @see POS_Source
 */
public class POS_MainClerk extends javax.swing.JPanel {

    private POSController controller;
    private MoneyFormatter moneyFormatter;
   /**
    * constructor for this class
    * @param control
    */
    public POS_MainClerk(POSController control) {
        initComponents();
        controller = control;
        moneyFormatter = new MoneyFormatter();
        setTotals();
        customInit();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        DynamicPanel = new javax.swing.JPanel();
        TitlePanel = new javax.swing.JPanel();
        LogoLabel = new javax.swing.JLabel();
        WelcomeLabel = new javax.swing.JLabel();
        NameLabel = new javax.swing.JLabel();
        LogoutButton = new javax.swing.JButton();
        ManagePanel = new javax.swing.JPanel();
        EditLabel1 = new javax.swing.JLabel();
        EditLabel2 = new javax.swing.JLabel();
        OverrideLabel = new javax.swing.JLabel();
        DiscountMenuLabel = new javax.swing.JLabel();
        OverrideButton = new javax.swing.JButton();
        DiscountButton = new javax.swing.JButton();
        ISLabel = new javax.swing.JLabel();
        CartPanel = new javax.swing.JPanel();
        CartLabel1 = new javax.swing.JLabel();
        CartLabel2 = new javax.swing.JLabel();
        ViewCartButton = new javax.swing.JButton();
        SubTotalLabel = new javax.swing.JLabel();
        SubTotalOut = new javax.swing.JLabel();
        TaxLabel = new javax.swing.JLabel();
        TaxOut = new javax.swing.JLabel();
        TotalLabel = new javax.swing.JLabel();
        TotalOut = new javax.swing.JLabel();
        ItemLabel = new javax.swing.JLabel();
        NumberLabel = new javax.swing.JLabel();
        SubTotalLabel1 = new javax.swing.JLabel();
        DiscountOut = new javax.swing.JLabel();
        OptionsPanel = new javax.swing.JPanel();
        SearchButton = new javax.swing.JButton();
        AddStoreCardButton = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));

        DynamicPanel.setBackground(new java.awt.Color(255, 255, 255));
        DynamicPanel.setPreferredSize(new java.awt.Dimension(800, 600));

        javax.swing.GroupLayout DynamicPanelLayout = new javax.swing.GroupLayout(DynamicPanel);
        DynamicPanel.setLayout(DynamicPanelLayout);
        DynamicPanelLayout.setHorizontalGroup(
            DynamicPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 800, Short.MAX_VALUE)
        );
        DynamicPanelLayout.setVerticalGroup(
            DynamicPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );

        TitlePanel.setBackground(new java.awt.Color(255, 255, 255));

        LogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/POS_Source/images/Logo.png"))); // NOI18N

        WelcomeLabel.setFont(new java.awt.Font("Tahoma", 0, 24));
        WelcomeLabel.setText("Clerk Options:");

        NameLabel.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        NameLabel.setText("Jane Doe");

        LogoutButton.setFont(new java.awt.Font("Tahoma", 0, 18));
        LogoutButton.setText("Log Out");

        javax.swing.GroupLayout TitlePanelLayout = new javax.swing.GroupLayout(TitlePanel);
        TitlePanel.setLayout(TitlePanelLayout);
        TitlePanelLayout.setHorizontalGroup(
            TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TitlePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(LogoLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 183, Short.MAX_VALUE)
                .addComponent(WelcomeLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(NameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LogoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        TitlePanelLayout.setVerticalGroup(
            TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TitlePanelLayout.createSequentialGroup()
                .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(TitlePanelLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(WelcomeLabel)
                            .addComponent(NameLabel)))
                    .addGroup(TitlePanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(TitlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(LogoutButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)
                            .addComponent(LogoLabel, javax.swing.GroupLayout.Alignment.LEADING))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        ManagePanel.setBackground(new java.awt.Color(255, 255, 255));
        ManagePanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        EditLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        EditLabel1.setText("Edit");

        EditLabel2.setFont(new java.awt.Font("Tahoma", 0, 24));
        EditLabel2.setText("Order");

        OverrideLabel.setFont(new java.awt.Font("Tahoma", 0, 18));
        OverrideLabel.setText("Override Price");

        DiscountMenuLabel.setFont(new java.awt.Font("Tahoma", 0, 18));
        DiscountMenuLabel.setText("Provide Discount");

        OverrideButton.setFont(new java.awt.Font("Tahoma", 0, 14));
        OverrideButton.setText("Go");
        OverrideButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OverrideButtonActionPerformed(evt);
            }
        });

        DiscountButton.setFont(new java.awt.Font("Tahoma", 0, 14));
        DiscountButton.setText("Go");
        DiscountButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DiscountButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout ManagePanelLayout = new javax.swing.GroupLayout(ManagePanel);
        ManagePanel.setLayout(ManagePanelLayout);
        ManagePanelLayout.setHorizontalGroup(
            ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ManagePanelLayout.createSequentialGroup()
                .addGroup(ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(ManagePanelLayout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addGroup(ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                                .addComponent(OverrideLabel)
                                .addComponent(DiscountMenuLabel)
                                .addComponent(DiscountButton, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(ManagePanelLayout.createSequentialGroup()
                                .addComponent(EditLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(EditLabel2)
                                .addGap(10, 10, 10))))
                    .addGroup(ManagePanelLayout.createSequentialGroup()
                        .addGap(57, 57, 57)
                        .addComponent(OverrideButton, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(48, Short.MAX_VALUE))
        );
        ManagePanelLayout.setVerticalGroup(
            ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ManagePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(ManagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(EditLabel1)
                    .addComponent(EditLabel2))
                .addGap(18, 18, 18)
                .addComponent(OverrideLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(OverrideButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(DiscountMenuLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(DiscountButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        ISLabel.setFont(new java.awt.Font("Lucida Console", 0, 11));
        ISLabel.setText("Powered by Interactive Solutions");

        CartPanel.setBackground(new java.awt.Color(255, 255, 255));
        CartPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        CartLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        CartLabel1.setText("Your");

        CartLabel2.setFont(new java.awt.Font("Tahoma", 0, 24));
        CartLabel2.setText("Cart");

        ViewCartButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        ViewCartButton.setText("View Cart");
        ViewCartButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ViewCartButtonActionPerformed(evt);
            }
        });

        SubTotalLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalLabel.setText("Subtotal:");

        SubTotalOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalOut.setText("$00.00");

        TaxLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        TaxLabel.setText("Tax:");

        TaxOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        TaxOut.setText("$00.00");

        TotalLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalLabel.setText("Total:");

        TotalOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        TotalOut.setText("$00.00");

        ItemLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        ItemLabel.setText("Items in Cart: ");

        NumberLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
        NumberLabel.setText("0");

        SubTotalLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
        SubTotalLabel1.setText("Discount:");

        DiscountOut.setFont(new java.awt.Font("Tahoma", 0, 14));
        DiscountOut.setText("$00.00");

        javax.swing.GroupLayout CartPanelLayout = new javax.swing.GroupLayout(CartPanel);
        CartPanel.setLayout(CartPanelLayout);
        CartPanelLayout.setHorizontalGroup(
            CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CartPanelLayout.createSequentialGroup()
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, CartPanelLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(ViewCartButton, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE))
                    .addGroup(CartPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(CartPanelLayout.createSequentialGroup()
                                .addGap(24, 24, 24)
                                .addComponent(SubTotalLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(DiscountOut, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))
                            .addGroup(CartPanelLayout.createSequentialGroup()
                                .addComponent(CartLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(CartLabel2))
                            .addGroup(CartPanelLayout.createSequentialGroup()
                                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ItemLabel)
                                    .addGroup(CartPanelLayout.createSequentialGroup()
                                        .addGap(25, 25, 25)
                                        .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(TotalLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(TaxLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(SubTotalLabel, javax.swing.GroupLayout.Alignment.TRAILING))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(NumberLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(TotalOut, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
                                    .addComponent(TaxOut, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
                                    .addComponent(SubTotalOut, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE))))))
                .addGap(35, 35, 35))
        );
        CartPanelLayout.setVerticalGroup(
            CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CartPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CartLabel1)
                    .addComponent(CartLabel2))
                .addGap(12, 12, 12)
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NumberLabel)
                    .addComponent(ItemLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CartPanelLayout.createSequentialGroup()
                        .addGap(75, 75, 75)
                        .addComponent(TotalOut))
                    .addGroup(CartPanelLayout.createSequentialGroup()
                        .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(SubTotalLabel1)
                            .addComponent(DiscountOut))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(SubTotalLabel)
                            .addComponent(SubTotalOut))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CartPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TaxLabel)
                            .addComponent(TaxOut))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(TotalLabel)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ViewCartButton, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                .addContainerGap())
        );

        OptionsPanel.setBackground(new java.awt.Color(255, 255, 255));
        OptionsPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        SearchButton.setFont(new java.awt.Font("Tahoma", 0, 18));
        SearchButton.setText("Search");
        SearchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SearchButtonActionPerformed(evt);
            }
        });

        AddStoreCardButton.setFont(new java.awt.Font("Tahoma", 0, 18));
        AddStoreCardButton.setText("Add Store Card");
        AddStoreCardButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddStoreCardButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout OptionsPanelLayout = new javax.swing.GroupLayout(OptionsPanel);
        OptionsPanel.setLayout(OptionsPanelLayout);
        OptionsPanelLayout.setHorizontalGroup(
            OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, OptionsPanelLayout.createSequentialGroup()
                .addGap(53, 53, 53)
                .addGroup(OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(AddStoreCardButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE)
                    .addComponent(SearchButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE))
                .addGap(50, 50, 50))
        );
        OptionsPanelLayout.setVerticalGroup(
            OptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, OptionsPanelLayout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(SearchButton, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(AddStoreCardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(TitlePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(CartPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(ManagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(OptionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(627, 627, 627)
                                .addComponent(ISLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(DynamicPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(TitlePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(ManagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(OptionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(CartPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(DynamicPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(41, 41, 41)
                        .addComponent(ISLabel)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
/**
 * this method handles view cart button press event
 * @param evt
 */
    private void ViewCartButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ViewCartButtonActionPerformed
        controller.CartScreen();
}//GEN-LAST:event_ViewCartButtonActionPerformed
/**
 * this method handles override  button press event
 * @param evt
 */
    private void OverrideButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OverrideButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_OverrideButtonActionPerformed
/**
 * this method handles discount  button press event
 * @param evt
 */
    private void DiscountButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DiscountButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DiscountButtonActionPerformed
/**
 * this method handles search  button press event
 * @param evt
 */
    private void SearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchButtonActionPerformed
        controller.SearchChoiceScreen();
}//GEN-LAST:event_SearchButtonActionPerformed
/**
 * this method handles add store card  button press event
 * @param evt
 */
    private void AddStoreCardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddStoreCardButtonActionPerformed
        controller.AddStoreCardScreen();
}//GEN-LAST:event_AddStoreCardButtonActionPerformed

/**
 * this method changes the screen by updating a panel dynamically
 * @param panel
 */
    public void changeScreen(JPanel panel){
        DynamicPanel.removeAll();
        panel.setBounds(0,0, 800,600);
        DynamicPanel.add(panel);
        DynamicPanel.validate();
        DynamicPanel.repaint();
        setTotals();
    }
/**
 * this method updates dynamic receipt
 */
    public void setTotals(){
        DiscountOut.setText(moneyFormatter.format(controller.getCart().getTotalDiscount()));
        NumberLabel.setText(controller.getNumItemsInCart());
        SubTotalOut.setText(moneyFormatter.format(controller.getCart().getSubtotal()));
        TaxOut.setText(moneyFormatter.format(controller.getCart().getTaxAmount()));
        TotalOut.setText(moneyFormatter.format(controller.getCart().getTotal()));
    }
/**
 * this method overrides default view rendering 
 */
    private void customInit(){
        NameLabel.setText(controller.getSessionManager().getOperatingClerk().getFirstName());
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddStoreCardButton;
    private javax.swing.JLabel CartLabel1;
    private javax.swing.JLabel CartLabel2;
    private javax.swing.JPanel CartPanel;
    private javax.swing.JButton DiscountButton;
    private javax.swing.JLabel DiscountMenuLabel;
    private javax.swing.JLabel DiscountOut;
    private javax.swing.JPanel DynamicPanel;
    private javax.swing.JLabel EditLabel1;
    private javax.swing.JLabel EditLabel2;
    private javax.swing.JLabel ISLabel;
    private javax.swing.JLabel ItemLabel;
    private javax.swing.JLabel LogoLabel;
    private javax.swing.JButton LogoutButton;
    private javax.swing.JPanel ManagePanel;
    private javax.swing.JLabel NameLabel;
    private javax.swing.JLabel NumberLabel;
    private javax.swing.JPanel OptionsPanel;
    private javax.swing.JButton OverrideButton;
    private javax.swing.JLabel OverrideLabel;
    private javax.swing.JButton SearchButton;
    private javax.swing.JLabel SubTotalLabel;
    private javax.swing.JLabel SubTotalLabel1;
    private javax.swing.JLabel SubTotalOut;
    private javax.swing.JLabel TaxLabel;
    private javax.swing.JLabel TaxOut;
    private javax.swing.JPanel TitlePanel;
    private javax.swing.JLabel TotalLabel;
    private javax.swing.JLabel TotalOut;
    private javax.swing.JButton ViewCartButton;
    private javax.swing.JLabel WelcomeLabel;
    // End of variables declaration//GEN-END:variables

}
